<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
        /* 后代选择器 */
      div span {
        color: red;
      }
      div p span {
        color: blue;
      }
      /* 子代选择器 */
      div > p > span {
        color: green;
      }
      /* 并集选择器 */
      h1,
      h2,
      h3,
      h4 {
        color: gray;
      }

      /* 交集选择器 */
      span.box {
        color: yellow;
      }
      .box.redBox {
        color: red;
      }
    </style>
  </head>
  <body>
    <div>
      <!-- 后代选择器 -->
      <!-- 子选择器 -->
      <div>
        <span>111</span>
        <p>
          <span>222</span>
        </p>
      </div>
    </div>
    <h1>1</h1>
    <h2>1</h2>
    <h3>1</h3>
    <h4>1</h4>
    <span class="box">66</span>
    <span class="box redBox">77</span>
  </body>
</html>
